import { ReactNode, RefObject } from 'react';
import { EnvironmentConfig } from './config/types.js';
import { ResolvedDataDependencies } from './constants.js';
import { ContentDescriptors } from './descriptors/index.js';
import { ModuleDescriptor } from './descriptors/Module.js';
import { IslandWithProps, IslandWithPropsAndUrl } from './islands/constants.js';
export interface BaseRenderContextValue {
    pageUrl: string;
    entryPointBasePath: string;
    supplementalFieldValues?: Record<string, any>;
    resolvedDataDependencies?: ResolvedDataDependencies | null;
}
export declare type LogParameter = string | number | boolean | Date | {
    [x: string]: LogParameter;
} | Array<LogParameter>;
export declare type LogParameters = Array<LogParameter>;
export declare type LogMessage = {
    level: 'warn' | 'error' | 'info';
    parameters: LogParameters;
};
export declare type InlineAssetLocation = 'CSS_HEAD' | 'JS_HEAD' | 'JS_FOOTER';
export interface InlineAsset {
    type: 'inline_html';
    html: string;
    location: InlineAssetLocation;
}
declare type ReactInlineAsset = Omit<InlineAsset, 'html'> & {
    render: () => JSX.Element;
};
export declare type CriticalDevError = {
    message: string;
    level: 'info' | 'warn' | 'error';
    error: Error;
};
export interface ServerRenderContextValue extends BaseRenderContextValue {
    islands: Array<IslandWithProps>;
    inlineAssets: Array<ReactInlineAsset>;
    readonly perServerRequestData?: Map<string, any>;
    readonly renderId: string;
    readonly environmentConfig: EnvironmentConfig;
    messagesForBrowser: Array<LogMessage>;
    criticalDevErrors?: Array<CriticalDevError>;
    modules?: Record<string, ModuleDescriptor>;
    contentDescriptors?: ContentDescriptors;
}
export declare const createServerRenderContext: (pageUrl: string | null, environmentConfig: EnvironmentConfig, sharedServerRequestData?: Map<string, any>) => ServerRenderContextValue;
export declare const createServerRenderContextV2: (pageUrl: string | null, { environmentConfig, entryPointBasePath, sharedServerRequestData, supplementalFieldValues, messagesForBrowser, resolvedDataDependencies, }: {
    environmentConfig: EnvironmentConfig;
    entryPointBasePath?: string;
    sharedServerRequestData?: Map<string, any>;
    supplementalFieldValues?: Record<string, any>;
    messagesForBrowser?: LogMessage[];
    resolvedDataDependencies?: ResolvedDataDependencies;
}) => ServerRenderContextValue;
export declare const createEmptyServerRenderContext: () => ServerRenderContextValue;
export declare const ServerRenderContext: import("react").Context<ServerRenderContextValue>;
export declare const useServerRenderContext: () => ServerRenderContextValue;
export interface ClientRenderContextValue extends BaseRenderContextValue {
    islands: Array<IslandWithPropsAndUrl>;
    hydrationFinished: RefObject<boolean>;
    island: IslandWithPropsAndUrl;
}
export declare const ClientRenderContextProvider: ({ children, islands, island, pageUrl, basePath, onTopLevelHydrationFinish, }: {
    children: ReactNode;
    islands: Array<IslandWithPropsAndUrl>;
    island: IslandWithPropsAndUrl;
    pageUrl: string;
    basePath: string;
    onTopLevelHydrationFinish?: () => void;
}) => JSX.Element;
export declare const useClientRenderContext: () => ClientRenderContextValue;
export declare const useRenderContext: () => BaseRenderContextValue;
export declare const useGetRenderRequestId: () => string;
export declare const useGetPerRequestMap_internal: () => Map<string, any>;
export declare const mergeServerRequestData_internal: (dataA: Map<string, any>, dataB: Map<string, any>) => Map<string, any>;
export declare const useInlineHeadAsset: (renderFunc: () => JSX.Element) => void;
export {};
